import React, { Component } from 'react';
import { Modal, Table } from 'antd';

const { Column } = Table;

interface VProps {
	visible?: any;
	data?: Array<Object>;
	onCancel?: Function;
}

class ViewDetail extends Component<VProps> {
	render() {
		let { visible, data, onCancel } = this.props;
		return (
			<>
				<Modal
					title="利润表"
					width={700}
					visible={visible}
					onCancel={() => {
						onCancel();
					}}
					onOk={() => {
						onCancel();
					}}
				>
					<Table dataSource={data}>
						<Column title="id" dataIndex="id" key="id" />
						<Column title="name" dataIndex="name" key="name" />
						<Column title="code" dataIndex="code" key="code" />
						<Column title="type_code" dataIndex="type_code" key="type_code" />
						<Column title="language" dataIndex="language" key="language" />
						<Column title="is_enabled" dataIndex="is_enabled" key="is_enabled" />
						<Column title="remark" dataIndex="remark" key="remark" />
					</Table>
				</Modal>
			</>
		);
	}
}

export default ViewDetail;
